import java.util.ArrayList;

public class p5 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int k = 20;
		int divisor = 2;
		int n = 2;

		while (divisor <= k) {
			if (n < divisor || n % divisor != 0) {
				n += 2;
				divisor = 1;
			}
			divisor++;
		}
		System.out.println(n);

		// advanced method
		int[] prime = getPrimesLessThan(k);
		int[] exponent = new int[prime.length];
		int limit = (int) Math.sqrt(k);
		n = 1;

		for (int i = 0; i < prime.length; i++) {
			if (prime[i] < limit) {
				exponent[i] = (int) (Math.log(k) / Math.log(prime[i]));
			} else {
				exponent[i] = 1;
			}
			n *= Math.pow(prime[i], exponent[i]);
		}
		System.out.println(n);
	}

	static int[] getPrimesLessThan(int n) {
		ArrayList<Integer> a = new ArrayList<Integer>();

		for (int i = 0; i <= n; i++) {
			if (isPrime(i)) {
				a.add(i);
			}
		}

		int[] ret = new int[a.size()];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = a.get(i).intValue();
		}
		return ret;
	}

	static boolean isPrime(int n) {
		if (n <= 1) {
			return false;
		}
		if (n == 2 || n == 3 || n == 5 || n == 7) {
			return true;
		}
		if (n % 2 == 0 || n % 3 == 0) {
			return false;
		}

		int limit = (int) Math.sqrt(n);
		int i = 0;

		do {
			i++;
			if (n % (6 * i - 1) == 0 || n % (6 * i + 1) == 0) {
				return false;
			}
		} while (6 * i + 1 < limit);

		return true;
	}
}
